import {HOST} from "@/api/hosts";
import {req_get_auth, req_post_auth} from "@/api/axiosFun";

export const addDepartment = (data) => {
    return req_post_auth("post",`${HOST}/departments`, data);
};

export const deleteDepartment = (id) => {
    return req_post_auth("delete",`${HOST}/departments/${id}`);
};

export const updateDepartment = (data) => {
    return req_post_auth("update",`${HOST}/departments`, data);
};

export const getAllDepartments = (params) => {
    return req_get_auth("get",`${HOST}/departments/page`, params);
};

export const listDepartments = () => {
    return req_get_auth("get",`${HOST}/departments`);
};